import logging
import time
import grpc
import test_pb2
import test_pb2_grpc


def run():
    with grpc.insecure_channel("localhost:10086") as channel:
        client = test_pb2_grpc.StreamTestStub(channel)  # 客户端使用Stub类发送请求
        response = client.ServerStream(test_pb2.request(message='start'))
        for i in response:
            print("return: ", i.message)


if __name__ == '__main__':
    logging.basicConfig()
    run()

